import request from "@/utils/request";

export function getSiteStatistics(params){
  return request({
    url: '/admin/getSiteStatistics',
    method: 'get',
    params:params,
  })
}

export function getIndexEditorStatistics(params = {}){
  return request({
    url: '/admin/getIndexEditorStatistics',
    method: 'get',
    params:params,
  })
}

export function getIndexTranslatorStatistics(params = {}){
  return request({
    url: '/admin/getIndexTranslatorStatistics',
    method: 'get',
    params:params,
  })
}

export function getEditorIndexList(params = {}){
  return request({
    url: '/admin/getEditorIndexList',
    method: 'get',
    params:params,
  })
}

export function getTranslatorIndexList(params = {}){
  return request({
    url: '/admin/getTranslatorIndexList',
    method: 'get',
    params:params,
  })
}

export function getAdminIndexList(params = {}){
  return request({
    url: '/admin/getAdminIndexList',
    method: 'get',
    params:params,
  })
}

/**
 * 根据权限获取对应的中文名
 * @param role
 * @returns {string}
 */
export function getRoleName(role) {
  switch (role) {
    case 'editor':
      return '编辑'
    case 'translator':
      return '翻译'
    case 'admin':
      return '管理员'
    default:
      return ''
  }
}




